#ifndef ACHIEVEMENTLISTXMLHANDLER_H
#define ACHIEVEMENTLISTXMLHANDLER_H

#include <QXmlDefaultHandler>
#include <QMap>

#include "data/Achievement.h"

class AchievementListXmlHandler : public QXmlDefaultHandler
{

public:
    explicit AchievementListXmlHandler();
    virtual bool characters(const QString &str);\
    virtual bool fatalError(const QXmlParseException &exception);
    virtual bool startElement(const QString &namespaceURI, const QString &localName,
                  const QString &qName, const QXmlAttributes &attributes);
    virtual bool endElement(const QString &namespaceURI, const QString &localName,
                const QString &qName);

    const QString& gameName() const;
    QMap<QString, Achievement> achievements() const;

private:
    QMap<QString, Achievement> m_achievementMap;
    QString m_currentText;
    Achievement m_currentAchievement;
    QString m_currentGameName;

};

#endif // ACHIEVEMENTLISTXMLHANDLER_H
